<template>
    <a-form-item :label="Options.Label">
        <a-select size="small" v-model:value="SelectValue">
            <a-select-option v-for="item in Dist" :key="item.value" :value="item.value">
                {{ item.label }}
            </a-select-option>
        </a-select>
    </a-form-item>
</template>
<script setup>
import { onMounted, ref, watch } from 'vue';
// import { GetLocalDist } from './Config.js'

const emit = defineEmits(['update:modelValue'])
const props = defineProps({
    Options: Object,
    // 表单数据
    modelValue: [String, Number],
});

const SelectValue = ref();

// console.log(props.Options);

watch(() => props.modelValue, val => {
    SelectValue.value = val;
}, { immediate: true });

watch(SelectValue, (val) => {
    emit('update:modelValue', val);
})

// 字典列表
const Dist = ref([]);

if (Array.isArray(props.Options.Dist)) {
    Dist.value = props.Options.Dist;
}

// onMounted(async () => {
//     Dist.value = await GetLocalDist(props.distName);
// });

</script>
<style lang="less" scoped>

</style>